import Quick from ".";
import { WeaInput, WeaLocaleProvider } from 'ecCom';
const { getLabel } = WeaLocaleProvider;

export default class Main extends Quick {
    state = {
        fieldMark: '',
        start: '',
        end: '',
    }
    getComponent = () => {
        const { fieldMark, start, end } = this.state;
        return [
            <div>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@qupd60@`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528639','请输入字段名称')}
                    value={fieldMark}
                    onChange={v => this.setState({ fieldMark: v })}
                />
            </div>,
            <div style={{marginTop:8}}>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@p0ijzo@`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528642','请输入开始日期') }
                    value={start}
                    onChange={v => this.setState({ start: v })}
                />
            </div>,
            <div style={{marginTop:8}}>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@a2a1ex@`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528643','请输入结束日期') }
                    value={end}
                    onChange={v => this.setState({ end: v })}
                />
            </div>
        ]
    }
    getTitle = () => {
        return 'excel.controlDateRange';
    }
    getScript = () => {
        return `excel.controlDateRange('${this.state.fieldMark}','${this.state.start}','${this.state.end}');`
    }
}